<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
    <style type="text/css">
      #parent{
        /* width: 300px; */
        height: 300px;
        background-color: green;
        /* position: relative; */
        display: flex;
        justify-content: center;
        align-items: center;
      }
      #child{
        width: 170px;
        height: 170px;
        background-color: red;
        /* position: absolute;
        left: 50%;
        /* margin-left: -75px; */
        /* top: 50%; */
        /* margin-top: -75px; */
        /* transform: translate(-50%,-50%); */
        
      }
    </style>
  </head>
  <body>
    <div id="parent">
      <div id="child">
        
      </div>
    </div>
  <script type="text/javascript">
    document.getElementById("parent").innerHTML = "hhh"
  </script>
  </body>
</html>
